package utils.global.constant;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ExceptionManager {

    @ExceptionHandler(BaseException.class)
    public RestfulJson exceptionInfo(BaseException exception) {
        log.error(exception.getMessage());
        exception.printStackTrace();
        return exception.getRestfulJson();
    }

}
